import 'package:flutter/foundation.dart';
import 'package:flutter_easy_permission/constants.dart';
import 'package:flutter_easy_permission/flutter_easy_permission.dart';
import 'package:permission_handler/permission_handler.dart';

class EcyPermission {
  static const permissions = [];

  static const permissionGroup = [PermissionGroup.DataNetwork];

  static requestPermissions() {
    FlutterEasyPermission.request(
        perms: [], permsGroup: permissionGroup, rationale: "");

    // bool ret =
    //     await FlutterEasyPermission.has(perms: [], permsGroup: permissionGroup);
  }

  static ObserverList() {
    FlutterEasyPermission()
      ..addPermissionCallback(
        onGranted: (requestCode, perms, perm) {},
        onDenied: (requestCode, perms, perm, isPermanent) {
          if (isPermanent) {
            FlutterEasyPermission.showAppSettingsDialog(title: "Camera");
          } else {}
        },
      );
  }
}
